package com.yohann.designPattern.strategy.duck;

import com.yohann.designPattern.strategy.fly.FlyBehavior;

/**
 * <p>
 * 鸭
 * </p>
 *
 * @author Yohann
 * @since 2021/2/13 18:19
 */
public abstract class Duck {
    public FlyBehavior behavior;

    public abstract void display();

    public void quack() {
        System.out.println("嘎嘎叫");
    }

    public void swim() {
        System.out.println("游泳");
    }

    public void fly() {
        behavior.fly();
    }
}